- /* sdmststr.cpp by K.Tsuru */
- // function ID 302 DRADIX
- /***************************************************************
- SDouble class
- It sets a value by the string such as
- "[+|-]ddd.ddd...[e[+|-]dd]".
- temp = t[th]...t[0]*DRADIX^snrdxExp
- v[0].v[aTail=1]...v[aHead]*DRADIX^rdxExp
- aHead = th+1
- v[0] = 0 , v[1] = t[th]...v[j] = t[aHead-j]...v[aHead] = t[0]
- rdxExp = aHead + snrdxExp +1
- ****************************************************************/
-
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- void SDouble::SetString(const char* s){
- StringToNumber temp(s);
- if( temp.Sign() == 0 ){ // = 0
- SetZero(); return;
- }
- uint tsz = temp.Head()+1, j;
- valloc( tsz, 0); // sign = 0;
-
- if(temp.Type() == DEC_INT){ //SDouble=integer
- Reserve(tsz); //size>=tsz+1
- rdxExp = (int)tsz;
- for(j = 1; j <= min(Size()-1, tsz); j++) figure[j] = temp[tsz-j];
- } else {
- rdxExp = temp.RdxExp();
- //It is possible that temp.Size()>Size()(temp.Head()+1 >= Size()).
- for(j = 1; j < min(Size(), tsz); j++) figure[j] = temp[j];
- }
- SetSign(temp.Sign());
- CheckArray(302);
- Reform(302);
- }
sdmststr.cpp : last modifiled at 2017/03/17 11:10:45(1,110 bytes)
created at 2017/10/07 10:21:14
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).